home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / glibc108.gz / glibc108 / glibc-1.08.1 / sysdeps / alpha / divl.S < prev    next >
Text File  |  1993-12-23  |  851b  |  55 lines

  1.       /* This file is generated from divrem.m4; DO NOT EDIT! */
  2. /* For each N divided by D, we do:
  3.       result = (double) N / (double) D
  4.    Then, for each N mod D, we do:
  5.       result = N - (D * divMODE (N, D))
  6.  
  7.    FIXME:
  8.    The q and qu versions won't deal with operands > 50 bits.  We also
  9.    don't check for divide by zero.  */
  10.  
  11. #include "DEFS.h"
  12. #if 0
  13. /* We do not handle div by zero yet.  */
  14. #include <machine/pal.h>
  15. #endif
  16. #include <regdef.h>
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. FUNC__(divl)
  24.     ! First set up the dividend.
  25.         sextl t10, t10
  26.  
  27.     stq t10,0(sp)
  28.     ldt $f10,0(sp)
  29.     cvtqt $f10,$f10
  30.     
  31.  
  32.     ! Then set up the divisor.
  33.         sextl t11, t11
  34.  
  35.     stq t11,0(sp)
  36.     ldt $f1,0(sp)
  37.     cvtqt $f1,$f1
  38.     
  39.  
  40.     ! Do the division.
  41.     divt $f10,$f1,$f10
  42.     cvttqc $f10,$f10
  43.  
  44.     ! Put the result in t12.
  45.     stt $f10,0(sp)
  46.     ldq t12,0(sp)
  47.         sextl t12, t12
  48.  
  49.  
  50.     
  51.  
  52.     lda sp,16(sp)
  53.     ret zero,(t9),1
  54.     .end NAME__(divl)
  55.